<?php
    // July, 16,2012: tunv rewrite this code
    class linktabsmodule {
        function name() { return "LinkTabs"; }
        function description() { return "Manage Linktabs."; }
        function author() { return "ABSoft.vn"; }

        function hasSources() { return true; }
        function hasContent() { return true; }
        function hasViews() { return true; }

        function supportsWorkflow() { return false; }

        function permissions($internal = "") {
            return array(
            'administrate'=>'Administrate',
            'configure'=>'Configure',
            'create'=>'Create Links',
            'edit'=>'Edit Links',
            'delete'=>'Delete Links'
            );
        }

        function show($view,$loc = null, $title = "") 
        {
            global $db;
            global $browser;
            
            $template = new template('linktabsmodule',$view,$loc);
            
            
            $template->assign('moduletitle',$title);
           
            $template->register_permissions(array('administrate','configure','create','edit','delete'),$loc);
            $template->output();
            
        }

        function deleteIn($loc) {
            global $db;
            $db->delete('linktabsmodule_link',"location_data='".serialize($loc)."'");
        }

        function copyContent($oloc,$nloc) {
            foreach ($db->selectObjects('linktabsmodule_link',"location_data='".serialize($oloc)."'") as $l) {
                $l->location_data = serialize($nloc);
                $db->insertObject($l,'linklist_link');
            }
        }

        function searchName() {
            return false;
        }
        
        function spiderContent($item = null) {
            return false;
        }
    }

?>
